import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '控制台' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import('../components/page/Dashboard.vue'),
                    meta: { title: '用户中心' }
                },
                {
                    path: '/usermanage',
                    component: () => import('../components/page/UserManage.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/elderlymanage',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/ElderlyManage.vue'),
                    meta: { title: '老人管理' }
                },
                {
                    path: '/nurseManage',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/NurseManage.vue'),
                    meta: { title: '护工管理' }
                },
                {
                    path: '/roommanage',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/RoomManage.vue'),
                    meta: { title: '房间管理' }
                },
                {
                    path: '/message',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Message.vue'),
                    meta: { title: '消息中心' }
                },

                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue')
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
